//Copyright 2010 Balazs Keri, Imre Keri
//
//This file is part of FireworksCreator.
//
//FireworksCreator is free software: you can redistribute it and/or modify
//it under the terms of the GNU General Public License as published by
//the Free Software Foundation, either version 3 of the License, or
//(at your option) any later version.
//
//FireworksCreator is distributed in the hope that it will be useful,
//but WITHOUT ANY WARRANTY; without even the implied warranty of
//MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
//GNU General Public License for more details.
//
//You should have received a copy of the GNU General Public License
//along with FireworksCreator.  If not, see <http://www.gnu.org/licenses/>.
//
#include <QBoxLayout>
#include "mainview.h"
#include "objectnameview.h"
#include "objtreeview.h"
#include "grouppage.h"
//
GroupPage::GroupPage(MainView *p_main_view,QWidget *p_parent)
:
   ObjectPage(p_main_view,p_parent),
   objects_view(new ObjTreeView(p_main_view,0,true,false))
{
   ObjectNameView *const name_view=new ObjectNameView();
   QVBoxLayout *const layout=new QVBoxLayout();
   layout->addWidget(name_view);
   layout->addWidget(objects_view);
   setLayout(layout);
   //
   objects_view->set_attr_group(get_attr_group());
   name_view->set_attr_group(get_attr_group());
   //set_group(0);
}
//
void GroupPage::handle_activate()
{
   objects_view->activate_actions();
}
void GroupPage::handle_deactivate()
{
   objects_view->deactivate_actions();
}
//
void GroupPage::set_group(model::Group *p_group)
{
   set_object(p_group);
}
model::Group *GroupPage::get_group() const
{
   return static_cast<model::Group*>(get_object());
}
